<%= form_for @okr, :html => {:class => 'form-horizontal okr-form', :multipart => true, :data => {:abide => true}} do |f| %>

    <div class="form-content form-below">
      <%= f.hidden_field :user_id,:value=>@user.id %>
      <div class='form-row'>
        <div class='small-3 columns'>
          <%= f.label :name, 'Name' %>
        </div>
        <div class='small-9 columns'>
          <%= f.text_field :name,:autofocus=>true,:required=>true %>
        </div>
      </div>
      <div class='form-row'>
        <div class='small-3 columns'>
          <%= f.label :start_date, 'Start date' %>
        </div>
        <div class='small-9 columns'>
          <%= f.text_field :start_date, :class => 'date-input',:required=>true %>
        </div>
      </div>
      <div class='form-row'>
        <div class='small-3 columns'>
          <%= f.label :end_date %>
        </div>
        <div class='small-9 columns'>
          <%= f.text_field :end_date, :class => 'date-input',:required=>true %>
        </div>
      </div>


      <div class="nested-title">
        Objectives:
      </div>

      <div id="objectives">
        <%= f.fields_for :objectives do |ob| %>
            <%= render 'objective_fields', :f => ob %>
        <% end %>
        <div class="links okr-field-add">
          <%= link_to_add_association 'Add objective', f, :objectives %>
        </div>
      </div>
    </div>
    <div class="small-12 columns form-action-up">
      <div class="title">Set OKR for <%= @user.name %></div>
      <div class="right">
        <%= f.submit "Save", :class => 'button alert right' %>
        <%= link_to t('.cancel', :default => t("helpers.links.cancel")),
                    okrs_path, :class => 'btn cancel-btn' %>
      </div>
    </div>

<% end %>



<script type="text/javascript">
    window.location = '#pane3'
    $('#okr_name').focus()
    $('select').not('.select_add').select2({'width': '100%'});
    $('.date-input').datetimepicker({timepicker:false,format:'Y-m-d'});
</script>



